package com.lsh.dao;

import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.springframework.stereotype.Repository;

/**
 * 用户头像dao类（UserHeadPortrait实体类）
 */
@Repository
public interface UserHeadPortraitDao {

    //注册创建user_headportrait表
    @Insert("insert into user_headportrait (uid) values (#{uid})")
    void saveHeadPortrait(int userId);

    //获取用户头像URL地址
    @Select("select URL from user_headportrait where uid = #{userId}")
    String getURL(int userId);

    //修改上传头像URL地址
    @Update("update user_headportrait set URL = #{URL} where uid = #{userId}")
    int updateHeadPortrait(@Param("userId") int userId, @Param("URL") String url);
}
